<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            width:0;
            height: 0;
            background-color: transparent;
            border: 50px solid #000;
            border-top: 50px solid transparent;
            border-bottom: 50px solid transparent;
            border-left: 50px solid transparent;
        }  
        .box2{
            width:300px;
            height: 300px;
            background: #000;
            clip-path: polygon(0 0,150px 150px,300px 0,0 0);
        }
    </style>
</head>
<body>
    <div class="box"></div> //border
    <div class="box2"></div> //裁剪

</body>
</html>